﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraSplashScreen;
using ISumen;
using Sumen.Business.Model.Presenter.Actor;
using Sumen_Stock.LookAndFeel.Entities;
using Sumen_Stock.LookAndFeel.Sumen_System;

namespace Sumen_Stock.LookAndFeel.Sales
{
    public partial class Frm_Search_Product : DevExpress.XtraEditors.XtraForm
    {
        private string _productDetailsId = "";
        private ProductPresenter _productPresenter;
        public Frm_Search_Product()
        {
            InitializeComponent();
            _productPresenter = new ProductPresenter();
        }

        private void Frm_Search_Product_Load(object sender, EventArgs e)
        {
            _productDetailsId = "";
            LoadForm();
        }


        private void LoadForm()
        {
            SplashScreenManager.ShowForm(typeof(WaitForm1));
            if (gridControl1.DataSource==null)
            {
            var list = _productPresenter.GetProductDetailsByKey(popupTree1.ChildListPrimaryKey);
                gridControl1.DataSource = list;
            }
            
            gridView1.BestFitColumns();
            SplashScreenManager.CloseForm();
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            LoadForm();
        }

        private void gridView1_DoubleClick(object sender, EventArgs e)
        {
            //_productDetailsId = gridView1.GetRowCellDisplayText(gridView1.FocusedRowHandle, colProductID);
            //this.Dispose();
        }





















    }
}